<?php //ob_start() ;?>
<?php $this->beginContent('/layouts/main'); ?>
<div region="north" style="height:65px;border:0px;">
	<div id="nav">
		<div class="logo_admin"></div>
		<div class="toolbar"></div>
		<div id="menu">
			<button class="sexybutton sexysimple sexylarge <?php if($this->menupanel[0]=='content') echo 'sexymagenta';?>" url="<?php echo Yii::app()->createUrl('news/index',array('menupanel'=>'content|news|index'));?>">内容管理</button>
			<button class="sexybutton sexysimple sexylarge <?php if($this->menupanel[0]=='ad') echo 'sexymagenta';?>" url='<?php echo Yii::app()->createUrl('ads/index',array('menupanel'=>'ads|ads|index'));?>'>广告管理</button>
			<button class="sexybutton sexysimple sexylarge <?php if($this->menupanel[0]=='page') echo 'sexymagenta';?>" url='<?php echo Yii::app()->createUrl('page/index',array('menupanel'=>'page|page|index'));?>'>页面管理</button>
			<button class="sexybutton sexysimple sexylarge <?php if($this->menupanel[0]=='user') echo 'sexymagenta';?>" url='<?php echo Yii::app()->createUrl('users/index',array('menupanel'=>'user|user|index'));?>'>用户管理</button>
			<button class="sexybutton sexysimple sexylarge <?php if($this->menupanel[0]=='option') echo 'sexymagenta';?>" url="<?php echo Yii::app()->createUrl('admin/index',array('menupanel'=>'option|admin|index'));?>">系统设置</button>
			<button class="sexybutton sexysimple sexylarge" url="<?php echo Yii::app()->createUrl('site/logout');?>">退出系统</button>
		</div>
		<div id="technology">注：<b>请尽量用Firefox浏览，或者IE8及以上版本</b></div>
	</div>
</div>

<?php 
// echo '<pre>'.print_r($this->menupanel , true) .'</pre>' ; exit ;
foreach ($this->leftmenu as $block=>$value):

?>
<?php
if($this->menupanel[0]===$block):	//$this->menupanel == array('content' , 'short' , 'index')
foreach ($value['submenu'] as $submenu_id=>$submenu):
?>
<div id="leftmenu">
	<div class="panel-header">
		<div class="panel-title"><?php echo $submenu['title'];?></div>
		<div class="panel-tool">
			<div></div>
		</div>
	</div>
	<div title="title" <?php if($this->menupanel[1]===$submenu_id)echo "selected='true'";?>>
		<ul class="vlist">
			<?php foreach ($submenu['item'] as $path=>$item):
			$modules = explode('|',$item['menupanel']);
			?>
			<li <?php if($this->menupanel[1]===$modules[1] && $this->menupanel[2]===$modules[2])echo "class='active'";?>>
				<a href="<?php echo Yii::app()->createUrl($path,array('menupanel'=>$item['menupanel']));?>"><?php echo $item['title'];?></a>
			</li>
			<?php endforeach;?>
		</ul>
	</div>
</div>
<?php endforeach;?>
<?php endif;?>
<?php endforeach;?>


<div region="center" title="操作面板" id="content">
	<div class="panel-header">
		<div class="panel-title">操作面板</div>
		<div class="panel-tool">
			<div></div>
		</div>
	</div>
        <?php echo $content?>
</div>



<?php $this->endContent(); ?>

<?php 
//$str = ob_get_contents ();
//ob_get_flush ();
//$path = dirname(dirname(__FILE__)) . "/static/layouts/column1.html";
//$handle = fopen ( $path, "w" );
//fwrite ( $handle, $str );
//fclose ( $handle );
?>





